{include file="admin/header.html} 
<div class="title">
    <h3>用户管理</h3>
</div>

<div class="condition">
    <form action="/admin/user" method="get">
        是否通过:<select name="pass">
            <option value="">所有</option>
            <option value="Y">已通过</option>
            <option value="N">未通过</option>
        </select>
        角色:<select name="role">
            <option value="">所有</option>
            {foreach from=$show_roles item=v key=k}
            <option value="{$k}">{$v}</option>
            {/foreach}
        </select>
        用户名:<input name="username" value="">
        真实姓名:<input name="realname" value=""/>
        入学时间:<input name="iyear" value=""/>
        关键字:<input name="key" value=""/>
        <input type="submit" value="筛选"/>
    </form>
</div>
<div class="table_zone">
    <table>
        <tr>
            <th>编号</th><th>用户名/真实姓名</th><th>电子邮件/电话</th><th>角色</th><th>入学时间/班级</th><th>工作单位</th><th>创建时间</th><th>是否通过</th>               
        </tr>
        {foreach from=$users item=v key=k}
        <tr {if $k%2 == 0}style="background-color:#EEE"{/if}>
            <td>{$v.userid}</td><td>{$v.username}<br/>{$v.realname}</td><td>{$v.email}<br/>{$v.phone}</td>
            <td>{$v.role}</td>
            <td>{$v.iyear}<br/>{$v.class}</td><td>{$v.workunit}</td><td>{$v.createtime}</td>
            <td>{if $v.pass eq "N"}<a href="javascript:;" onclick="pass({$v.userid})" title="点击通过">未通过</a>{else}已通过{/if}</td>
        </tr>
        {/foreach}
    </table>
    <div class="paging">{$paging}</div>
</div>
{literal}
<script>
    function pass(userid){
        r = confirm("确认要通过？");
        if(r){
            $.get("/admin/userpass?userid="+userid, function(d){
                document.location.reload();
            })
        }
    }
</script>
{/literal}
{include file="admin/footer.html"}